{extend name="layout:base" /}{block name="content"}
 <?php
$global=isSupperManagerForSession();
 ?>
 <style>
.table th{text-align:center;}
.tip{
position:absolute;
background:#9FC;
border-color:#F60;
z-index:9999;
filter:alpha(opacity=80);  
-moz-opacity:0.8;  
-khtml-opacity: 0.8;  
opacity: 0.8;  
}
.hidden-detail{
  display:none;
}
.mypointer{
width:95%;overflow:hidden;height:25px;line-height:25px;cursor: pointer;
}
</style>

<link rel="stylesheet" type="text/css" href="/static/admin/css/style.css" />
<script src="/static/mimi/js/confirm/js/jquery-1.9.1.js"></script>
<script src="/static/bootstrap/js/bootstrap.min.js"></script>

<link rel="stylesheet" href="/static/mimi/css/animate.min.css" type="text/css" />
<link rel="stylesheet" href="/static/mimi/css/font-awesome.min.css" type="text/css" />
   
<section class="topBanners">
   <div class="icon"></div>
   <div class="topBannersNav">
   		<span data-url="/admin/tmsgcode/lists" onclick="ContentLoadGo('/admin/tmsgcode/lists')">短信管理</span>
   </div>
</section>
   
<section style="margin-top:10px;margin-left:auto;margin-right:auto;">
      <select name="ser_key" id="ser_key" class="select" >
       <option value="tel" <?php if($request['ser_key']=="tel"){echo 'selected';} ?>>手机号</option>
      </select>
      <input type="text" class="textbox" name="ser_val" id="ser_val" value="<?php echo $request['ser_val']; ?>" placeholder=""/>
      <input type="button" value="搜索" class="group_btn research" id="resource" page="1" />

      <br style="clear:both;width:0px;height:0px;">
</section>
 
<table class="table" style="margin-top:10px;">
<tr>
<th style="width:50px;">ID</th>
<th style="width:100px;">手机号</th>
<th style="width:100px;">类型</th>
<th style="width:100px;">验证码</th>
<th style="width:100px;">状态</th>
<th style="width:100px;">发送时间</th>

</tr>

<?php 
foreach($lists['data'] as $key=>$val)
{
?>
<tr data-id="<?php echo $val['id']; ?>">
<td style="text-align:left;"><?php echo $val['id']; ?></td>

<td><?php echo $val['tel'];?></td>
<td>
    <?php
        if($val['types']==1){echo "注册";}
        elseif($val['types']==2){echo "找回密码";}
        elseif($val['types']==3){echo "快捷登录";}
        elseif($val['types']==4){echo "绑定支付宝";}
        elseif($val['types']==5){echo "绑定微信";}
    ?>
</td>
<td><?php echo $val['codes'];?></td>
<td>
    <?php
        if($val['uses']==0){echo "未使用";}
        elseif($val['uses']==1){echo "已使用";}

    ?>
</td>
    <td><?php echo date("Y-m-d H:i:s",$val['mtime']);?></td>


<?php
}
?>
</table>
{include file="../application/admin/view/layout/page_tpl_new.html" /}
<script type="text/javascript">
function myResearch(){
	 var url="/admin/tmsgcode/lists";
	 var ser_key =$("#ser_key").val();
	 var ser_val =$("#ser_val").val()
	 var ser_stats =$("#ser_stats").val();
	 var page=$("#cpage").val();
	 var param={
		   ser_key:ser_key, 
		   ser_val:ser_val, 
		   ser_stats:ser_stats,
		   page:page
	 };
	 ContentLoadGo(url,param);
}
     
      
$(function(){
        	   //设置搜索栏
    	 $(".research").unbind().bind("click",function(){
    		   var page =$(this).attr("page");
    		   $("#cpage").val(page);
    		   myResearch();
    	 });


//详情
    $(".saleList").unbind().bind("click",function(){
        var that =this;
        var url="/admin/tmsgcode/saleLists";
        var id=$(that).parent().parent().attr('data-id');
        var param={
            class_id:id
        };
        ContentLoadGo(url,param);
    });



    $(".shang").unbind().bind("click",function(){
      		   var that =this;
      		   var url="/admin/tmsgcode/shangData";
      		   var id=$(that).parent().parent().attr('data-id');
      		   var param={
      				   id:id
      		   };
      		   cofirmsss_tishi(1,'您确定要执行该操作吗？',function(id){
      			 
      			   AjaxRequest(url,param,function(data){
          			   if(data.err==0)
          			   {
          				   SuccessTiShi("操作成功");
          				   
          				   $(that).parent().parent().remove();
          				   myResearch();
          			   }
          			   else
          			   {
          				   ErrTiShi(data.msg);
          			   }
          		   });
      			   
      		   });
      	   });


    $(".copyAdd").unbind().bind("click",function(){
        var that =this;
        var url="/admin/tmsgcode/copyAdd";
        var id=$(that).parent().parent().attr('data-id');
        var param={
            id:id
        };
        cofirmsss_tishi(1,'您确定要执行该操作吗？',function(id){

            AjaxRequest(url,param,function(data){
                if(data.err==0)
                {
                    SuccessTiShi("操作成功");

                    $(that).parent().parent().remove();
                    myResearch();
                }
                else
                {
                    ErrTiShi(data.msg);
                }
            });

        });
    });
      	
      	   
      	   $(".xia").unbind().bind("click",function(){
      		   var that =this;
      		   var url="/admin/tmsgcode/xiaData";
      		   var id=$(that).parent().parent().attr('data-id');
      		   var param={
      				   id:id
      		   };
      		   cofirmsss_tishi(1,'您确定要执行该操作吗？',function(id){
      			 
      			   AjaxRequest(url,param,function(data){
          			   if(data.err==0)
          			   {
          				   SuccessTiShi("操作成功");
          				   
          				   $(that).parent().parent().remove();
          				   myResearch();
          			   }
          			   else
          			   {
          				   ErrTiShi(data.msg);
          			   }
          		   });
      			   
      		   });
      	   });
      	
      	   
        	   $(".del").unbind().bind("click",function(){
        		   var that =this;
        		   var url="/admin/tmsgcode/delData";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   id:id
        		   };
        		   cofirmsss_tishi(1,'您确定要删除吗?',function(id){
        			 
        			   AjaxRequest(url,param,function(data){
            			   if(data.err==0)
            			   {
            				   SuccessTiShi("操作成功");
            				   
            				   $(that).parent().parent().remove();
            				   myResearch();
            			   }
            			   else
            			   {
            				   ErrTiShi("操作失败");
            			   }
            		   });
        			   
        		   });
        	   });
        	
        	   $(".mission").unbind().bind("click",function(){
        		   var that =this;
        		   var url="/admin/classmission/lists";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   class_id:id
        		   };
        		   ContentLoadGo(url,param);
        			
        	   });
        	   
        	   $(".edit").unbind().bind("click",function(){
        		   var that =this;
        		   var url="/admin/tmsgcode/editData";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   id:id
        		   };
        		   ContentLoadGo(url,param);
        			
        	   });

        	   $(".info").unbind().bind("click",function(){
        		   var that =this;
        		   var url="/admin/tmsgcode/infoData";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   id:id
        		   };
        		   ContentLoadGo(url,param);
        			
        	   });
        	   
        	   //导航
     
               $(".topBannerItem").unbind().bind("click",function(){
         		   var attArr = $(this).attr();
             	   goToSelfLink(attArr);
             	   
         			
         	   });
         	  $(".add").unbind().bind("click",function(){
        		   
        		   var that =this;
        		   var url="/admin/tmsgcode/addData";
        		   var param={};
        		   ContentLoadGo(url,param);
        			 //弹出：确认按钮
        			
        	   });
        	   
  			   //全选
  		  $("#all").unbind().bind("click",function(){
			    	if(this.checked){   
			        	$(".checkBoxInput").attr("checked", true);  
			        	$(".checkBoxInput").prop("checked", true);  
			    	}else{   
						$(".checkBoxInput").attr("checked", false);
						$(".checkBoxInput").prop("checked", false);
			    	}   
			    	var se=getAllSelectItem();
			    	//console.log(se);
			}); 
  			   
  			   
});
</script>
	  
<script>
$(function (){
    $("[data-toggle='tooltip']").tooltip();
});
</script>
{/block}
   